<?php
$str = "This is Hello World in Php!";
while (preg_match("/[A-Z]/", $str, $matches)) {
  echo $search =  $matches[0];
  $str = str_replace($search,strtolower($search),$str);

}
